package com.deep.spring.v19;

import org.springframework.context.annotation.DeferredImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.ArrayList;
import java.util.List;

public class MyGroup implements DeferredImportSelector.Group {
    private AnnotationMetadata annotationMetadata;

    @Override
    public void process(AnnotationMetadata metadata, DeferredImportSelector selector) {
        System.out.println("my group process");
        this.annotationMetadata = metadata;
    }

    @Override
    public Iterable<Entry> selectImports() {
        System.out.println("my group selectImports");

        List<Entry> list = new ArrayList<>();
//        list.add(new Entry(this.annotationMetadata, "com.deep.spring.v19.bean.Zerson"));
//        list.add(new Entry(this.annotationMetadata, "com.deep.spring.v19.bean.Person"));
        list.add(new Entry(this.annotationMetadata, "com.deep.spring.v19.bean.Aerson"));
        list.add(new Entry(this.annotationMetadata, "com.deep.spring.v19.bean.Zerson"));
        list.add(new Entry(this.annotationMetadata, "com.deep.spring.v19.bean.Person"));

        return list;
    }
}